package de.mrclrchtr.education.account.dto

import de.mrclrchtr.education.account.jooq.tables.pojos.Role
import de.mrclrchtr.education.account.jooq.tables.pojos.User
import java.io.Serializable

data class RoleDto(
    var id: Int? = null,
    var name: String? = null,
    var userList: MutableList<User>? = null
) : Serializable

// 将 jOOQ 生成的 Role 对象转换为 RoleDto 对象
{
    companion object {
        @JvmStatic
        fun convertToCustomRole(role: Role, userList: MutableList<User>): RoleDto {
            return RoleDto(role.id, role.name, userList)
        }
    }
}